#include "trap.h"
    .set noreorder
    .global main 
    .text 

main:
    li $t1, 0xc5e0fd00
    li $t0, 0xc5e0fd00
    sw $t1, 0x0000b55c($t0)
    lhu $s0, 0x0000b55e($t0)
    li $s2, 0x0000c5e0
    bne $s0, $s2, inst_error
    nop

    li $t1, 0x75e313d0
    li $t0, 0x8010993c
    sw $t1, 0x0000456c($t0)
    lhu $s0, 0x0000456c($t0)
    li $s2, 0x000013d0
    bne $s0, $s2, inst_error
    nop

    li $t1, 0x43106c00
    li $t0, 0x80107bf8
    sw $t1, 0x000078c8($t0)
    lhu $s0, 0x000078ca($t0)
    li $s2, 0x00004310
    bne $s0, $s2, inst_error
    nop

    # 地址错误异常
    li $s0, 0x2b771238
    li $t1, 0xcd7ab654
    li $t0, 0x80108294
    sw $t1, 0x000079f4($t0)
    lhu $s0, 0x000079f5($t0)
    li $s2, 0x2b771238
    bne $s0, $s2, inst_error
    nop

    HIT_GOOD_TRAP

inst_error:
    HIT_BAD_TRAP